<?php
/* @var $this CommentsController */
/* @var $model Comments */

$this->breadcrumbs = array(
    '评论' => array('admin'),
    '列表',
);

$this->menu = array(
    array('label' => '列表', 'url' => array('admin')),
    array('label' => '高级搜索', 'url' => 'javascript:void(0)', 'linkOptions' => array('class' => 'search-button')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('comments-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>评论列表</h1>

<div class="search-form" style="display:none">
    <?php
    $this->renderPartial('_search', array(
        'model' => $model,
    ));
    ?>
</div><!-- search-form -->

<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'comments-grid',
    'dataProvider' => $model->search(),
    //'filter' => $model,
    'columns' => array(
        'id',
        'post_id',
        'comment_author',
        'comment_author_email',
        'comment_author_url',
        'comment_author_ip',
        /*
          'comment_date',
          'comment_content',
          'comment_parent',
          'comment_approved',
          'comment_karma',
          'user_id',
         */
        array(
            'class' => 'CButtonColumn',
        ),
    ),
));
?>
